package com.hex.ds.hdrs.watch.exec;

import lombok.extern.slf4j.Slf4j;

/**
 * @author lwz
 * @date 2021-02-23
 * @des
 */
@Slf4j
// @EnableScheduling   邮件发生不需要
// @Component
public class WatchSendExec {
    /*@Autowired
    private CenterManager centerManager;
    @Autowired
    private WatchSendService watchSendService;

    @Scheduled(fixedDelayString = "${scheduled.watchSend.noticLogToSendLogFixedDelay}",initialDelayString = "${scheduled.watchSend.noticLogToSendLogInitialDelay}")
    public void noticLogToSendLog() {
        log.info("运行日志转邮件或短信发送记录【WatchSendExec.noticLogToSendLog】-线程号：" , Thread.currentThread().getName());
        try {
            if (centerManager.isMaster()) {
                this.watchSendService.noticLogToSendLog();
            }
        }catch (Exception e){
            log.error("运行日志转邮件或短信发送记录【WatchSendExec.noticLogToSendLog】【异常】======》" , e);
             
        }finally {
            log.info("运行日志转邮件或短信发送记录【WatchSendExec.noticLogToSendLog】线程号：" ,Thread.currentThread().getName());
        }
    }

    @Scheduled(fixedDelayString = "${scheduled.watchSend.mailSendFixedDelay}",initialDelayString = "${scheduled.watchSend.mailSendInitialDelay}")
    public void mailSend() {
        log.info("邮件发送【WatchSendExec.mailSend】-线程号：" , Thread.currentThread().getName());
        try {
            if (centerManager.isMaster()) {
                this.watchSendService.mailSend();
            }
        }catch (Exception e){
            log.error("邮件发送【WatchSendExec.mailSend】【异常】======》" , e);
             
        }finally {
            log.info("邮件发送【WatchSendExec.mailSend】线程号：" , Thread.currentThread().getName());
        }
    }

    //@Scheduled(fixedDelayString = "${scheduled.watchSend.smsSendFixedDelay}",initialDelayString = "${scheduled.watchSend.smsSendInitialDelay}")
    public void smsSend() {
        log.info("短信发送【WatchSendExec.smsSend】-线程号：" , Thread.currentThread().getName());
        try {
            if (centerManager.isMaster()) {
                this.watchSendService.smsSend();
            }
        }catch (Exception e){
            log.error("短信发送【WatchSendExec.smsSend】【异常】======》" , e);
             
        }finally {
            log.info("短信发送【WatchSendExec.smsSend】线程号：" , Thread.currentThread().getName());
        }
    }*/
}
